import request from '../utils/http.js';

export async function login(data) {
    return request({
        url: '/user/login',
        method: 'post',
        data
    });
}

export async function userInfo(data) {
    return request({
        url: '/user/info/' + data,
        method: 'get'
    });
}

export async function getUserList() {
    return request({
        url: '/user/list',
        method: 'get'
    });
}

export async function addUser(data) {
    return request({
        url: '/user/insert',
        method: 'post',
        data
    });
}

export async function updateUser(data) {
    return request({
        url: '/user/update',
        method: 'post',
        data
    });
}

export async function deleteUser(data) {
    return request({
        url: '/user/delete/' + data,
        method: 'get'
    });
}

export async function recoverUser(data) {
    return request({
        url: '/user/recover/' + data,
        method: 'get',
        data
    });
}
